package net.hn.hnms.biz.mine.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 智呈物联 pan'sx
 * 2022/9/6 14:23
 * 1.0 version
 */
@Entity
@Table(name = "dim_wechart_msg", schema = "public", catalog = "huaneng-smart-mine")
@Data
@ApiModel("消息发送对象")
public class WeChartMessage {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "custom-id")
    @GenericGenerator(name = "custom-id", strategy = "net.hn.hnms.biz.common.jpa.utils.CustomIDGenerator")
    private  Long id;
    @Column(length = 40)
    @ApiModelProperty("预警地点")
    private String  earlyWarnAddr;
    @Column(length = 20)
    @NotNull(message = "预警级别不可为null")
    @ApiModelProperty("预警级别")
    private String earlyWarnLevel;
    @Column(length = 30)
    private String earlyWarnType;
    @Column(columnDefinition="text")
    @ApiModelProperty("消息内容")
    @NotNull(message = "预警级别不可为null")
    private String earlyWarnText;
    @Column(length = 1000)
    @ApiModelProperty("应对措施")
    private String earlyWarnMeasures;
    @Column(columnDefinition="text")
    @ApiModelProperty(value = "接收人,后端赋值",hidden = true)
    private String toUsers;
    @Column(length = 30)
    @ApiModelProperty(value = "发布系统")
    private String publishSys;
    @Column(columnDefinition="text")
    @ApiModelProperty(value = "响应结果，后端维护")
    private String weChartResponse;
    @Column(length = 60)
    @ApiModelProperty(value = "创建人，后端维护")
    private Long creatUser;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm",
            timezone = "Asia/Shanghai"
    )
    @ApiModelProperty(value = "创建时间，后端维护")
    private Date creatTime;
    @ApiModelProperty(value = "接收人工号，前端传值")
    @Transient
    private List<String> userIds  = new ArrayList<>();;
    @ApiModelProperty(value = "井下站点区域，前端传值")
    @Transient
    private List<String> stationCodes = new ArrayList<>();
    @ApiModelProperty(value = "发送密码")
    @Transient
    private String sendPwd;
}
